package com.mj.common.sdk.api;

import java.util.Map;

import com.mj.common.config.AppConfig;
import com.mj.common.sdk.beans.oauth2.Oauth2OpenId;
import com.mj.common.sdk.tools.HttpUtil;
import com.mj.common.sdk.tools.ParaMap;

public class Oauth2GetOpenIdCilent extends AbstractClient {

	public Oauth2OpenId getOauth2GetOpenId(String code) {
		final String appId = apiConfig.getAppId();
		final String appSecret = apiConfig.getAppSecret();
		Map<String, String> queryParas = ParaMap.create("appid", appId).put("secret", appSecret).put("code", code).getData();
		String json = HttpUtil.get(AppConfig.WEI_XIN_ATHUN, queryParas);
		return new Oauth2OpenId(json);
	}
}
